<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>消息通知</title>
    <base href="<?php echo base_url(); ?>"/>
    <link href="style/base.css" rel="stylesheet" type="text/css" />
    <link href="style/common.css" rel="stylesheet" type="text/css" />
    <link href="style/houtai.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function(){
            $("#houtai_msg_list").find("dt").click(function(){

                var id = $('#houtai_msg_list').find('dt').attr('id');

                $.ajax({
                    url:'index.php/manage/setSmsRead?id='+id,
                    type:'get',
                    success:function(data){

                    }
                })


                var dd =$(this).siblings("dd");
                var dl=$(this).parent("dl");
                if(dd.css("display")!="none"){
                    dd.hide();
                    dl.removeClass("grey");
                    return;
                }



                var dls =dl.siblings();
                dls.removeClass("grey");
                dl.addClass("grey");
                dls.find("dd").hide();
                dd.show();

            })
        })
    </script>
    <!--[if IE 6]>
    <script type="text/javascript" language="javascript" src="js/ie6/DD_belatedPNG_0.0.8a-min.js"></script>
    <script type="text/javascript" language="javascript">
        DD_belatedPNG.fix('.logo img,.footer_logo img');
    </script>
    <![endif]-->
</head>

<body>
<!-- head S-->
<?php
include 'header.php';
?>
<!-- head E-->

<div class="houtai_content mt_10 clearfix">
    <!-- 侧栏 开始 -->
    <?php
    include 'member_left.php';
    ?>
    <!-- 侧栏 结束 -->

    <!-- 消息 开始 -->
    <div class="houtai_main">
        <div class="houtai_msg">
            <div class="houtai_msg_tab">
                <ul>
                    <li <?php if(isset($type) && $type=='2'){echo "class='cur'";}?>><a href="index.php/manage/message">全部消息</a></li>
                    <li <?php if(isset($type) && $type=='0'){echo "class='cur'";}?>><a href="index.php/manage/message?type=0"><span><?php echo $message['count'];?>条</span>未读消息</a></li>
                    <li <?php if(isset($type) && $type=='1'){echo "class='cur'";}?>><a href="index.php/manage/message?type=1">已读消息</a></li>
                </ul>
            </div>

            <div class="houtai_msg_cnt">
                <div class="houtai_main_tit">用户中心—消息通知</div>
                <div id="houtai_msg_list">

                    <?php if(!empty($message['data'])){?>

                    <?php foreach($message['data'] as $item):?>

                            <dl>
                                <dt id="<?php echo $item['id'];?>"><a href="javascript:void(0)"><?php echo $item['title'];?></a><span><?php echo $item['createtime'];?></span></dt>
                                <dd>
                                    <?php echo $item['content'];?>
                                </dd>
                            </dl>
                        <?php endforeach;?>
                    <?php }else{?>
                        <div class="houtai_index_dt">
                            <div class="no">暂无动态信息</div>
                        </div>


                    <?php }?>

                </div>
            </div>
        </div>
    </div>
    <!-- 消息 结束 -->
</div>

<!-- 底部 S -->
<?php
include 'footer.php';
?>
<!-- 底部 E -->
</body>
</html>
